<template>
	<div>
		<el-dialog title="展示轮播效果" :visible.sync="showVisible" :before-close="closeShowRotation" @open="opendEnd">
			<template>
			  <el-carousel :interval="3000" arrow="always">
			    <el-carousel-item v-for="item in rotationList" :key="item.bannerId" v-if="item.status==1">
			      <!-- <h3>{{ item }}</h3> -->
            <img :src="item.bannerImg" width="100%" height="100%"/>
			    </el-carousel-item>
			  </el-carousel>
			</template>
			<span slot="footer" class="dialog-footer">
				<el-button @click="closeShowRotation">关 闭</el-button>
			</span>
		</el-dialog>
	</div>
</template>

<script>
  export default {
  	name: "",
  	props: ["showVisible","showObj"],
    data() {
    	return {
    		rotationList: {},
    	}
    },
    methods: {
      closeShowRotation() {
        this.$parent.showVisible = false
      },
      opendEnd(){
        this.rotationList = this.$props.showObj
        console.log(this.rotationList)
        // this.rotationList.bannerId = this.$props.editorObj.bannerId
        // this.rotationList.bannerName = this.$props.editorObj.bannerName
        // this.rotationList.status = this.$props.editorObj.status
        // this.onstatus(this.$props.editorObj.status)
      },
    },
  }
</script>

<style scoped>
  .el-carousel__item h3 {
      color: #475669;
      font-size: 18px;
      opacity: 0.75;
      line-height: 300px;
      margin: 0;
    }
    .el-carousel__item:nth-child(2n) {
      background-color: #99a9bf;
    }
    .el-carousel__item:nth-child(2n+1) {
      background-color: #d3dce6;
    }
</style>
